# # print(1 + 2 - 3)
# # print(1 + 2 * 3)
# # print(1 + 2 / 3)
#
#
# print(2 / 3)

# avg = (67.5 + 89.0 + 12.9 + 32.2) / 4
# total = (67.5 - avg) ** 2 + (89.0 - avg) ** 2 + (12.9 - avg) ** 2 + (32.2 - avg) ** 2
# result = total / 3
# print(result)

# avg = (67.5 + 89.0 + 12.9 + 32.2) / 4
# total = (67.5 - avg) ** 2 + (89.0 - avg) ** 2 + (12.9 - avg) ** 2 + (32.2 - avg) ** 2
# result = total / 3
# print(result)

# a = 10
# print(a)
#
# a = 20
# print(a)
#
# b = 30
# a = b
# print(a)


# a = 10
# print(type(a))
#
# a = 0.5
# print(type(a))
#
# a = "hello"
# print(type(a))


# a = "hello"
# print(len(a))

# a = "hello "
# b = "Python"
# print(a + b)

# a = True
# print(type(a))
# b = False
# print(type(b))


# print("hello Python")

# a = 10
# print(a)
#
# b = True
# print(b)

# num = 10
# print(f"num = {num}")

# a = 10
# print(f"a = {a}")
# b = 20
# print(f"b = {b}")


# a = 10
# print(f"a = {a}")
# b = 20
# print(f"b = {b}")
# c = 30
# print(f"c = {c}")

# num = 0
# num = input("请输入一个整数:\n")
# print(f"你输入的整数是: {num}")


# num = 0
# num = input("请输入一个整数:")
# print(f"你输入的整数是: {num}")


# num = 0
# num = input("请输入一个整数: ")
# print(f"你输入的整数是: {num}")

# a = input("请输入一个整数: ")
# b = input("请输入一个整数: ")
# print(f"a + b = {a + b}")

# a = input("请输入一个整数: ")
# b = input("请输入一个整数: ")
# a = int(a)
# b = int(b)
# print(f"a + b = {a + b}")

# a = input("请输入一个整数: ")
# b = input("请输入一个整数: ")
# a = int(a)
# b = int(b)
# print(f"a + b = {a + b}")

# a = input("请输入一个数字: ")
# b = input("请输入一个数字: ")
# c = input("请输入一个数字: ")
# d = input("请输入一个数字: ")
#
# a = float(a)
# b = float(b)
# c = float(c)
# d = float(d)
#
# avg = (a + b + c + d) / 4
#
# print(f"平均值: {avg}")


# a = input("请输入一个数字: ")
# b = input("请输入一个数字: ")
# c = input("请输入一个数字: ")
# d = input("请输入一个数字: ")
#
# a = float(a)
# b = float(b)
# c = float(c)
# d = float(d)
#
# avg = (a + b + c + d) / 4
#
# print(f"avg = {avg}")

# print(10 / 0)

# print(1 / 2)

# print(1 % 2)

# print(4 ** 2)

# print(4 ** 0.5)

# print(1 // 2)
# print(-1 // 2)

# a = 10
# b = 20
# c = 30

# print(a < b < c)
# print(a < b < c)

# a = 10
# b = 20
#
# a, b = b, a
#
# print(a)
# print(b)

# a = 10
# a = a + 1
# print(a)
#
# b = 10
# b += 1
# print(b)

# choice = input("输入1 表示认真学习 | 输入2 表示躺平摆烂: ")
#
# if choice == "1":
#     print("你一定会找到好工作!\n")
# elif choice == "2":
#     print("你可能毕业就失业了!\n")
# else:
#     print("你的输入有误!\n")


# choice  = input("输入1 表示认真学习 | 输入2 表示躺平摆烂: ")
#
# if choice == "1":
#     print("你一定会找到好工作!\n")
# elif choice == "2":
#     print("你毕业可能就失业了!\n")
# else:
#     print("你的输入有误!\n")


# a = input("请输入一个整数: ")
# if a == "1":
#     print("hello")
#     print("world")

# a = input("请输入一个整数: ")
# if a == "1":
#     print("hello")
# print("world")


# a = input("请输入一个整数: ")
# if a == "1":
#     print("Hello")
#     print("Python")

# a = input("请输入一个整数: ")
# if a == "1":
#     print("Hello")
#     print("Python")


# a = input("请输入一个整数: ")
# if a == "1":
#     print("Hello")
#     print("Python")


# a = input("请输入第一个整数: ")
# b = input("请输入第二个整数: ")
#
# if a == "1":
#     if b == "2":
#         print("hello")
#     print("world")
# print("Python")


# 判断奇偶数
# a = input("请输入一个整数: ")
# a = int(a)
#
# if a % 2 == 0:
#     print("偶数")
# else:
#     print("奇数")



# a = int(input("请输入一个整数: "))
# if a % 2 == 0:
#     print("偶数")
# else:
#     print("奇数")


# 判断正负数
# a = int(input("输入一个整数: "))
# if a > 0:
#     print("正数")
# elif a < 0:
#     print("负数")
# else:
#     print("0")


# 判断年份是否为闰年
# year = int(input("请输入一个整数: "))
# if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
#     print("闰年")
# else:
#     print("平年")

# year = int(input("请输入一个整数: "))
# if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
#     print("闰年")
# else:
#     print("平年")

# a = int(input("请输入一个整数: "))
# if a == 1:
#     print("hello")

# a = int(input("请输入一个整数: "))
# if a != 1:
#     pass
# else:
#     print("hello")


# num = 1
# while num <= 10:
#     print(num)
#     num += 1


# sum = 0
# num = 1
# while num <= 100:
#     sum += num
#     num += 1
# print(sum)

# sum = 0
# num = 1
# while num <= 100:
#     sum += num
#     num += 1
# print(f"sum = {sum}")


# 计算5的阶乘
# result = 1
# n = 1
# while n <= 5:
#     result *= n
#     n += 1
# print(result)


# result = 1
# n = 1
# while n <= 5:
#     result *= n
#     n += 1
# print(f"result = {result}")

# 练习2

# num = 1
# sum = 0
# while num <= 5:
#     factorResult = 1
#     i = 1
#     while i <= num:
#         factorResult *= i
#         i += 1
#     sum += factorResult
#     num += 1
# print(sum)

# num = 1
# sum = 0
# while num <= 5:
#     factorResult = 1
#     i = 1
#     while i <= num:
#         factorResult *= i
#         i += 1
#     sum += factorResult
#     num += 1
# print(sum)


# for i in range(1, 11):
#     print(i)


# for i in range(2, 11, 2):
#     print(i)

# for i in range(10, 0, -1):
#     print(i)

# sum = 0
# for i in range(1, 101):
#     sum += i
# print(sum)


# for i in range(1, 6):
#     if i == 3:
#         continue
#     print(f"吃完第{i}个包子")


# sum = 0
# count = 0
# while True:
#     num = input("请输入数字: ")
#     if num == ";":
#         break
#     num = float(num)
#     sum += num
#     count += 1
# print(sum / count)


# print("+-------------------------------------------------------------+")
# print("|                                                             |")
# print("|                   花有重开日, 人无再少年                        |")
# print("|                                                             |")
# print("|                   欢迎来到,人生模拟重开器                       |")
# print("|                                                             |")
# print("+-------------------------------------------------------------+")

# # 设置初始属性
# while True:
#     print("请设置初始属性(可用总点数 20)")
#     face = int(input("设置 颜值(1 - 10): "))
#     strong = int(input("设置 体质(1 - 10): "))
#     iq = int(input("设置 智力(1 - 10): "))
#     home = int(input("设置 家境(1 - 10): "))

#     if face < 1 or face > 10:
#         print("颜值设置有误!")
#         continue
#     if strong < 1 or strong > 10:
#         print("体质设置有误!")
#         continue
#     if iq < 1 or iq > 10:
#         print("智力设置有误!")
#         continue
#     if home < 1 or home > 10:
#         print("家境设置有误!")
#         continue

#     if face + strong + iq + home > 20:
#         print("总点数超过了20")
#         continue

#     print("初始属性设置完成!")
#     break


# # 设置性别
# point = random.randint(1, 6)
# if point % 2 == 1:
#     gender = "boy"
#     print("你是一个男孩")
# else:
#     gender = "girl"
#     print("你是一个女孩")

# #设置出生点
# point = random.randint(1, 3)
# if home == 10:#第一档
#     print("你出生在帝都, 你的父母是高级官员")
#     home += 1
#     iq += 1
#     face += 1
# elif 7 <= home <= 9:# 第二档
#     if point == 1:
#         print("你出生在大城市, 你的父母是公务员")
#         face += 2
#     elif point == 2:
#         print("你出生在大城市, 你的父母是企业高管")
#         home += 2
#     else:
#         print("你出生在大城市, 你的父母是大学教授")
#         iq += 2
# elif 4 <= home <= 6:#第三档
#     if point == 1:
#         print("你出生在三线城市, 你的父母是教师")
#         iq += 1
#     elif point == 2:
#         print("你出生在镇上, 你的父母是医生")
#         strong += 1
#     else:
#         print("你出生在镇上, 你的父母是个体户")
#         home += 1
# else:#第四档
#     if point == 1:
#         print("你出生在村里, 你的父母是辛苦劳作的农民")
#         strong += 1
#         face -= 2
#     elif point == 2:
#         print("你出生在穷乡僻壤, 你的父母是无业游民")
#         home -= 2
#     else:
#         print("你出生在镇上, 你的父母感情不和")
#         strong -= 1

# # 针对每一岁, 生成一个人生经历
# for age in range(1, 11):
#     info = f"你今年 {age} 岁, "
#     point = random.randint(1, 3)

#     #性别触发事件
#     if gender == "girl" and home <= 3 and point == 1:
#         info += "你家里人重男轻女思想非常严重, 你被遗弃了!"
#         print(info)
#         print("游戏结束!")
#         sys.exit(0)
#     #体质触发事件
#     elif strong < 6 and point != 3:
#         info += "你生了一场病, "
#         if home >= 5:
#             info += "在父母的精心照料下恢复了健康"
#             strong += 1
#             home -= 1
#         else:
#             info += "你的父母没精力管你, 你的身体状况更糟糕了!"
#             strong -= 1
#     #颜值触发事件
#     elif face < 4 and age >= 7:
#         info += "你长得太丑的, 别的小朋友都不喜欢你, "
#         if iq > 5:
#             info += "你决定用学习填充自己"
#             iq += 1
#         else:
#             if gender == "boy":
#                 info += "你和别的小朋友经常打架"
#                 iq -= 1
#                 strong += 1
#             else:
#                 info += "你经常被别的小朋友欺负"
#                 strong -= 1


# #练习1:字符串
# A = input('输入字符串:')

# B = A[::2]
# C = A[::-1]
# D = A[:4]+C[1:]
# print(len(A))
# print(B)
# print(C)
# print(D)

# # 练习2
# i=100
# j=50
# t=0
# while i>=0 :
#     #输出100-50
#     if(i>=j):
#         print(i)
#         i-=1
#     else:
#         #输出0-50
#         if(i+1>=t):
#            print(t)
#            t+=1

# #练习3
# def DeleteString(str1, str2):
#     if str1 is None or str2 is None:
#         return
#     for i in str1:
#         if i in str2:
#             str1 = str1.replace(i, '')  # 进行字符替换
#     return ''.join(str1)

# print(DeleteString("They are students", "aeiou"))
